<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=encoding">
		<title><?php echo X_Env::_('pcstream_title'); ?></title>
		<script type="text/javascript" 
		        src="http://www.google.com/jsapi"></script>
		<script type="text/javascript">
		  // You may specify partial version numbers, such as "1" or "1.3",
		  //  with the same result. Doing so will automatically load the 
		  //  latest version matching that partial revision pattern 
		  //  (e.g. 1.3 would load 1.3.2 today and 1 would load 1.4.2).
		  google.load("jquery", "1.4");
		 
		  google.setOnLoadCallback(function() {
		    // Place init code here instead of $(document).ready()
			    $('#pause').click(function () {
				    $.get('<?php echo $this->pause; ?>');
			    });
			    $('#stop').click(function () {
				    $.get('<?php echo $this->stop; ?>', function() {
				    	history.back();
				    });
			    });
			    $('#rewind').click(function () {
				    $.get('<?php echo $this->seek; ?>'+(-1 * $('#time').val()));
			    });
			    $('#forward').click(function () {
				    $.get('<?php echo $this->seek; ?>'+$('#time').val());
			    });
		  });
		</script>		
	</head>
    <body>
    <h1><?php echo X_Env::_('pcstream_title'); ?></h1>
    <?php if ( $this->showVideo ) :?>
    <div>
		<object id="MediaPlayer1" width="320" height="240" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"  type="application/x-oleobject" standby="Filmato in corso di caricamento...">
		
		<param name="AutoStart" value="true"> <!-- Il filmato parte al caricamento della pagina -->
		<param name="FileName" value="<?php echo $this->stream;?>"> <!-- Istruzione molto importante in quanto permette di indicare il filmato da visualizzare -->
		<param name="ShowControls" value="false"> <!-- non mostra i controlli di WMP -->
		<param name="ShowStatusBar" value="false"> <!-- mostra la barra di stato -->
		<param name="loop" value="false"> <!-- alla fine del filmato esso viene nuovamente riprodotto -->
		
		<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="<?php echo $this->stream; ?>" name="MediaPlayer1" width="320" height="240" autostart="1" showcontrols="0" showstatusbar="0" showdisplay="0">
		
		</embed>
		
		</object>
	</div>
    <?php endif; ?>
    <div>
    	<button id="pause"><?php echo X_Env::_('pause_resume'); ?></button>
    	<button id="stop"><?php echo X_Env::_('stop'); ?></button>
    	<button id="rewind"><?php echo X_Env::_('rewind'); ?></button>
    	<button id="forward"><?php echo X_Env::_('forward'); ?></button>
    	<input type="text" id="time" name="time" value="300" /> sec
    </div>
    
    </body>
</html>